package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.pojo.Category;


import com.itheima.service.CategoryClientService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author wuyiqiang
 * @2022/6/18 15:12
 */
@RestController
@RequestMapping(value = "/category", produces = "application/json;charset=utf-8")
public class CategoryClientController {

    @Autowired
    private CategoryClientService categoryClientService;

    /**
     * 分类查询
     * @return
     */
    @GetMapping("/list")
    public R selectAll() {
        List<Category> selectAll = categoryClientService.selectAll();
        return R.success(selectAll);
    }
}
